-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/trie: persist TrieJournal to journal file instead of kv database #2341
Conversation
426ee1f
to
37ffdfb
Compare
30d1328
to
a63a4b9
Compare
a63a4b9
to
239cdb1
Compare
65cf980
to
88efafc
Compare
The solution is ok for me, it would bring some advantages: It can be merged once there are >2 approval. |
88efafc
to
4e89289
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
core: fix some comment core: rename some variable
ae50a33
to
af15ebf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR provides another way to persist TrieJournal by write it into a log file instead of a kv database.
Use
--journalFile
flag to enable/disable the journal file feature.Rationale
Persisting TrieJournal to KV database will cause problems below
Changes:
Data Format
Journal Version
Disk Root
Disk Layer
--
**Layer Length**
-- Root
-- State ID
-- Buffer Nodes
--
**Layer Checksum**
Diff Layer
--
**Layer Length**
-- Root
-- Block
-- Trie Nodes
-- Journal Accounts
--
**Layer Checksum**
Journal Path: geth/chaindata/ancient/state.journal
Checksum: SHA256
Testing
Function test
kill -15
signal, the journal is persisted with a size consistent with the file.geth/chaindata/ancient/state.journal
) and restart.Performance test
Scenario: Using TestJournal, each layer has 4K and 8K account operations.
Conclusion: The use of Journal WAL and storing trieJournalKey directly into kvdb results in nearly identical WAL write times during shutdown and WAL read/parsing times during startup.